<?php


namespace app\index\controller;


use app\common\controller\Basecontroller;
use app\index\model\Examine;
use app\index\model\Official;
use think\Db;
use think\Request;

class Personaudit  extends  Basecontroller
{
    /**
     * 人事审核页中，获取投档的用户信息接口
     * ywh开发
     * @param Official $official
     * @param Request $request
     * @return \think\response\Json
     * @throws \think\exception\DbException
     */
    public function personnelAudit(Official $official , Request $request){
        $human = $this->getUserID();
        $state = $request->post('state') ?  $request->post('state') : [1,2,3,4,5];
        $currPage = $request->post('currPage');
        return $this->returnJson(self::OK,'返回了应聘用户的信息',$official->getExamineTo($human,$state,$currPage));
    }

    /**人事审核页中，修改投档用户的状态接口
     * ywh开发
     * 接口是否开发完：否
     * @param Official $official
     * @param Request $request
     * @return \think\response\Json
     */
    public function peUpState(Official $official , Request $request){
        $data = [
            'applyPhone'    =>      $request->post('applyPhone'),
            'commit'            =>      $request->post('commit')
        ];
        if (!$official->upExamine($data['applyPhone'],$data['commit'])) return $this->returnJson(self::ERROR,'数据库错误');
        return $this->returnJson(self::OK,'修改成功');
    }
}